package com.onesports.intelligent.k12.polarlight.mapper.market;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.onesports.intelligent.k12.polarlight.domain.dto.operation.PageOperationHomeDTO;
import com.onesports.intelligent.k12.polarlight.domain.entity.market.Message;
import com.onesports.intelligent.k12.polarlight.domain.vo.operation.PageOperationMessageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 消息表
 *
 * @author
 * @since 1.0.0 2022-07-08
 */
@Mapper
public interface MessageMapper extends BaseMapper<Message> {

    /**
     * 分页查询运营端 消息通知列表
     *
     * @param page 分页参数
     * @param dto  消息类型和消息内容
     * @return 消息VO
     */
    IPage<PageOperationMessageVO> page(@Param("page") Page<PageOperationHomeDTO> page,
                                       @Param("dto") PageOperationHomeDTO dto);

    /**
     * function： 根据消息类型或许未读数量
     *
     * @param dto      入参
     * @return Long    消息未读数量
     * @author wangcx
     * @since 2022/7/26 10:54
     */
    Long countNoRead(@Param("dto") PageOperationHomeDTO dto);
}
